package com.tyfspring.beans.factory;

import com.tyfspring.beans.exception.BeansException;

/**
 * @Description Bean容器
 * @Author shallow
 * @Date 2023/3/26 12:54
 */
public interface BeanFactory {

    /**
     * 根据name获取bean
     * @param name bean名称
     * @return
     * @throws RuntimeException
     */
    Object getBean(String name) throws BeansException;

    Object getBean(String name, Object... args) throws BeansException;

//    /**
//     * 容器中是否有bean
//     * @param name bean名称
//     * @return
//     */
//    boolean containsBean(String name);

    /**
     * 根据名称和类型查找bean
     *
     * @param name
     * @param requiredType
     * @param <T>
     * @return
     * @throws BeansException
     */
    <T> T getBean(String name, Class<T> requiredType) throws BeansException;

    <T> T getBean(Class<T> requiredType) throws BeansException;


}
